package org.whuims.pois.action;

import org.apache.struts.action.ActionServlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class ControllerServlet extends ActionServlet {
    private static final long serialVersionUID = -1967288521493475334L;

    protected void service(HttpServletRequest arg0, HttpServletResponse arg1)
            throws ServletException, IOException {
        //调用ActionServlet 中的process方法
        this.process(arg0, arg1);
        //从request中读取返回给ajax的数据JSONObject
        //如果此数据存在，则返回
        String result = (String) arg0.getAttribute("ajaxResult");
        System.out.println(result);
        arg1.getWriter().print(result);

    }

}